package com.open.capacity.notice.enums;

import java.util.Map;

import com.baomidou.mybatisplus.annotation.EnumValue;

import lombok.Getter;

@Getter
public enum MsgType implements BaseEnum<MsgType> {

	NULL(0, "未知"), TEXT(1, "文本");

	@EnumValue
	private Integer code;
	private String name;

	MsgType(int code, String name) {
		this.code = code;
		this.name = name;
	}

	public static MsgType of(Integer code) {
		return BaseEnum.parseByCode(MsgType.class, code);
	}

	public static Map<Integer, String> toMap() {
		return BaseEnum.toMap(MsgType.class);
	}
}
